﻿CREATE FUNCTION dbo.NLin_NSIProductState
	(
	@ID int
	)
RETURNS int
AS
	BEGIN
	DECLARE @linksCount int
	
	SELECT @linksCount = COUNT(ID) FROM PRODUCT_UNIT WHERE NSI_PRODUCT_STATE_ID = @ID
	
	RETURN @linksCount
	END
